//
//  UIColor+RGB.m
//  JSToolkit
//
//  Created by 정재성 on 2013. 11. 10..
//  Copyright (c) 2013년 정재성. All rights reserved.
//

#import "UIColor+RGB.h"

@implementation UIColor (RGB)

+ (UIColor *)colorWithRGB:(NSUInteger)rgb
{
    return [UIColor colorWithRed:((rgb & 0xFF0000) >> 16) / 255.0f
                           green:((rgb & 0x00FF00) >>  8) / 255.0f
                            blue:((rgb & 0x0000FF) >>  0) / 255.0f
                           alpha:1.0f];
}

+ (UIColor *)colorWithARGB:(NSInteger)argb
{
    return [UIColor colorWithRed:((argb & 0x00FF0000) >> 16) / 255.0f
                           green:((argb & 0x0000FF00) >>  8) / 255.0f
                            blue:((argb & 0x000000FF) >>  0) / 255.0f
                           alpha:((argb & 0xFF000000) >> 24) / 255.0f];
}

@end
